package bjtu.tjj.simpledy.common;


public enum ResultCode {
    /**
     * 0 - 1000 常规
     */
    SUCCESS(0, "成功"),
    FAILED(101, "失败"),
    ARGUMENT_NOT_VALID(102, "参数不正确"),
    NOT_LOGIN(103, "请先登录"),
    LOGIN_EXPIRES(104, "登录过期"),
    NO_RESOURCE_FOUND(105, "资源不存在"),
    FILE_TOO_LARGE(106, "文件过大，上传失败"),
    /**
     * 1001 - 2000 用户
     */
    USERNAME_EXIST(1001, "该用户名已被注册"),
    USERNAME_NOT_EXIST(1002, "用户名不存在"),
    INCORRECT_PWD(1003, "密码不正确"),
    AVATAR_UPLOAD_FILED(1004, "头像上传失败"),
    USER_NOT_EXIST(1005, "用户不存在"),
    /**
     * 2001 - 3000 视频
     */
    LABEL_TOO_LONG(2001, "视频文案过长"),
    ILLEGAL_VIDEO_SUFFIX(2002, "视频后缀不正确"),
    SAVE_FAILED(2003, "视频保存失败"),
    VIDEO_NOT_EXIST(2004, "视频不存在"),
    /**
     * 3001 - 4000 推荐
     */
    NO_MORE_RECOMMEND(3001, "没有能推荐的视频了"),
    /**
     * 4001 - 5000 点赞
     */
    ALREADY_LIKED(4001, "已经点过赞了或视频不存在"),
    NOT_LIKE_YET(4002, "还未点赞或视频不存在"),
    ;

    public final Integer value;
    public final String defaultMsg;

    ResultCode(Integer value, String defaultMsg) {
        this.value = value;
        this.defaultMsg = defaultMsg;
    }

    @Override
    public String toString() {
        return "ResultCode.%s(value=%s, defaultMsg=%s)".formatted(super.toString(), value, defaultMsg);
    }
}
